3.39 \(\int \frac{\cos (a+\frac{b}{x})}{x^4} \, dx\)

Optimal. Leaf size=46 \[ \frac{2 \sin \left (a+\frac{b}{x}\right )}{b^3}-\frac{2 \cos \left (a+\frac{b}{x}\right )}{b^2 x}-\frac{\sin \left (a+\frac{b}{x}\right )}{b x^2} \]

[Out]

(-2*Cos[a + b/x])/(b^2*x) + (2*Sin[a + b/x])/b^3 - Sin[a + b/x]/(b*x^2)

________________________________________________________________________________________

Rubi [A]  time = 0.0467186, antiderivative size = 46, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25, Rules used = {3380, 3296, 2637} \[ \frac{2 \sin \left (a+\frac{b}{x}\right )}{b^3}-\frac{2 \cos \left (a+\frac{b}{x}\right )}{b^2 x}-\frac{\sin \left (a+\frac{b}{x}\right )}{b x^2} \]

Antiderivative was successfully verified.

[In]

Int[Cos[a + b/x]/x^4,x]

[Out]

(-2*Cos[a + b/x])/(b^2*x) + (2*Sin[a + b/x])/b^3 - Sin[a + b/x]/(b*x^2)

Rule 3380

Int[((a_.) + Cos[(c_.) + (d_.)*(x_)^(n_)]*(b_.))^(p_.)*(x_)^(m_.), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplif
y[(m + 1)/n] - 1)*(a + b*Cos[c + d*x])^p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IntegerQ[Simpl
ify[(m + 1)/n]] && (EqQ[p, 1] || EqQ[m, n - 1] || (IntegerQ[p] && GtQ[Simplify[(m + 1)/n], 0]))

Rule 3296

Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> -Simp[((c + d*x)^m*Cos[e + f*x])/f, x] +
Dist[(d*m)/f, Int[(c + d*x)^(m - 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 2637

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \frac{\cos \left (a+\frac{b}{x}\right )}{x^4} \, dx &=-\operatorname{Subst}\left (\int x^2 \cos (a+b x) \, dx,x,\frac{1}{x}\right )\\ &=-\frac{\sin \left (a+\frac{b}{x}\right )}{b x^2}+\frac{2 \operatorname{Subst}\left (\int x \sin (a+b x) \, dx,x,\frac{1}{x}\right )}{b}\\ &=-\frac{2 \cos \left (a+\frac{b}{x}\right )}{b^2 x}-\frac{\sin \left (a+\frac{b}{x}\right )}{b x^2}+\frac{2 \operatorname{Subst}\left (\int \cos (a+b x) \, dx,x,\frac{1}{x}\right )}{b^2}\\ &=-\frac{2 \cos \left (a+\frac{b}{x}\right )}{b^2 x}+\frac{2 \sin \left (a+\frac{b}{x}\right )}{b^3}-\frac{\sin \left (a+\frac{b}{x}\right )}{b x^2}\\ \end{align*}

Mathematica [A]  time = 0.0041019, size = 46, normalized size = 1. \[ \frac{2 \sin \left (a+\frac{b}{x}\right )}{b^3}-\frac{2 \cos \left (a+\frac{b}{x}\right )}{b^2 x}-\frac{\sin \left (a+\frac{b}{x}\right )}{b x^2} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[a + b/x]/x^4,x]

[Out]

(-2*Cos[a + b/x])/(b^2*x) + (2*Sin[a + b/x])/b^3 - Sin[a + b/x]/(b*x^2)

________________________________________________________________________________________

Maple [A]  time = 0.033, size = 92, normalized size = 2. \begin{align*} -{\frac{1}{{b}^{3}} \left ( \left ( a+{\frac{b}{x}} \right ) ^{2}\sin \left ( a+{\frac{b}{x}} \right ) -2\,\sin \left ( a+{\frac{b}{x}} \right ) +2\, \left ( a+{\frac{b}{x}} \right ) \cos \left ( a+{\frac{b}{x}} \right ) -2\,a \left ( \cos \left ( a+{\frac{b}{x}} \right ) + \left ( a+{\frac{b}{x}} \right ) \sin \left ( a+{\frac{b}{x}} \right ) \right ) +{a}^{2}\sin \left ( a+{\frac{b}{x}} \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(a+b/x)/x^4,x)

[Out]

-1/b^3*((a+b/x)^2*sin(a+b/x)-2*sin(a+b/x)+2*(a+b/x)*cos(a+b/x)-2*a*(cos(a+b/x)+(a+b/x)*sin(a+b/x))+a^2*sin(a+b
/x))

________________________________________________________________________________________

Maxima [C]  time = 1.36795, size = 68, normalized size = 1.48 \begin{align*} \frac{{\left (i \, \Gamma \left (3, \frac{i \, b}{x}\right ) - i \, \Gamma \left (3, -\frac{i \, b}{x}\right )\right )} \cos \left (a\right ) +{\left (\Gamma \left (3, \frac{i \, b}{x}\right ) + \Gamma \left (3, -\frac{i \, b}{x}\right )\right )} \sin \left (a\right )}{2 \, b^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(a+b/x)/x^4,x, algorithm="maxima")

[Out]

1/2*((I*gamma(3, I*b/x) - I*gamma(3, -I*b/x))*cos(a) + (gamma(3, I*b/x) + gamma(3, -I*b/x))*sin(a))/b^3

________________________________________________________________________________________

Fricas [A]  time = 1.51528, size = 95, normalized size = 2.07 \begin{align*} -\frac{2 \, b x \cos \left (\frac{a x + b}{x}\right ) +{\left (b^{2} - 2 \, x^{2}\right )} \sin \left (\frac{a x + b}{x}\right )}{b^{3} x^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(a+b/x)/x^4,x, algorithm="fricas")

[Out]

-(2*b*x*cos((a*x + b)/x) + (b^2 - 2*x^2)*sin((a*x + b)/x))/(b^3*x^2)

________________________________________________________________________________________

Sympy [A]  time = 6.18221, size = 46, normalized size = 1. \begin{align*} \begin{cases} - \frac{\sin{\left (a + \frac{b}{x} \right )}}{b x^{2}} - \frac{2 \cos{\left (a + \frac{b}{x} \right )}}{b^{2} x} + \frac{2 \sin{\left (a + \frac{b}{x} \right )}}{b^{3}} & \text{for}\: b \neq 0 \\- \frac{\cos{\left (a \right )}}{3 x^{3}} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(a+b/x)/x**4,x)

[Out]

Piecewise((-sin(a + b/x)/(b*x**2) - 2*cos(a + b/x)/(b**2*x) + 2*sin(a + b/x)/b**3, Ne(b, 0)), (-cos(a)/(3*x**3
), True))

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\cos \left (a + \frac{b}{x}\right )}{x^{4}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(a+b/x)/x^4,x, algorithm="giac")

[Out]

integrate(cos(a + b/x)/x^4, x)